#include <iostream>

using namespace std;

typedef long long LL;

const int N = 1e5 + 10;
LL a[N], n, k;
int main()
{
	cin >> n >> k;
	a[0] = 1;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j <= k && i - j >= 0; j++)
		{
			a[i] += a[i - j];
		}
	}
	cout << a[n] << endl;
	return 0;
}
